package com.ruoyi.web.pojo.dto.devicedata;

import com.ruoyi.web.utils.influxdb.DeviceData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class DeviceFactorCountData {

    @ApiModelProperty(value = "double类型数据")
    private Double dValue;

//    @ApiModelProperty(value = "int类型数据")
//    private Integer iValue;

    @ApiModelProperty(value = "日期")
    private String date;

    public DeviceFactorCountData(DeviceData deviceData) {
        this.dValue = deviceData.getValue();
        this.date = deviceData.getDataDateStr();
    }

    public DeviceFactorCountData(DeviceData deviceData,String key) {
        if(deviceData == null){
            return;
        }
        this.dValue = deviceData.getBaseValue(key);
        this.date = deviceData.getDataDateStr();
    }
}
